package cn.edu.xaut.mybatisers.mall.Dao;

import cn.edu.xaut.mybatisers.mall.Entity.Bill;
import cn.edu.xaut.mybatisers.mall.Entity.Commodity;
import cn.edu.xaut.mybatisers.mall.Entity.OrderOneByOne;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.MapKey;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface BillDao {
    ArrayList<Bill> selectByOrderNumber(String order_number) throws SQLException;
    void createOrder(Bill bill) throws SQLException;
    void alterOrder(Bill bill) throws SQLException;
    ArrayList<Bill> getAllOrder(int consumer_id) throws SQLException;
    void addCommodityToOrder(List<OrderOneByOne> orderOneByOnes) throws SQLException;
    ArrayList<Bill> findBillByStatus(int consumer_id, int billStatus) throws SQLException;
    List<HashMap<String, Object>> getCommodities(String orderNumber) throws SQLException;
    ArrayList<Commodity> getCommodities1(String orderNumber) throws SQLException;
    Commodity selectCommodityById(Commodity commodity) throws SQLException;
    Boolean decRepertory_number(String orderNumber) throws SQLException;
    @MapKey("commodity_id")
    HashMap<Integer, HashMap> selectOrderObOByOrderNumber(String orderNumber) throws SQLException;
    void alterCommodityRepertoryNumber(List<Commodity> commodities) throws SQLException;
    int deleteOrder(Bill bill) throws SQLException;
    void comment(OrderOneByOne orderOneByOne) throws SQLException;
}
